#CMake最低版本号要求
cmake_minimum_required(VERSION 2.8)
#指定项目名称
project(BSTest)
add_definitions(-std=c++11)
#指定编译目录
include_directories(
    ${PROJECT_SOURCE_DIR}/inc 
    ${PROJECT_SOURCE_DIR}/json11
    ${PROJECT_SOURCE_DIR}/jsconfig 
    ${PROJECT_SOURCE_DIR}/lib 
    ${PROJECT_SOURCE_DIR}/libmodbus 
    ${PROJECT_SOURCE_DIR}/modbusserver
    ${PROJECT_SOURCE_DIR}/rtubuffer
    ${PROJECT_SOURCE_DIR}/rtuserver
)
set(PROJECT_BINARY_DIR ${PROJECT_SOURCE_DIR}/build)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
add_executable(BSModbusBridge 
    main.cpp 
    json11/json11.cpp 
    jsonconfig/jsonconfig.cpp
    modbusserver/modbusserver.cpp 
    rtubuffer/rtubuffer.cpp
    rtuserver/rtuserver.cpp
)
target_link_libraries(BSModbusBridge modbus rt pthread)